<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>站点管理</title>
    <%@ include file="../../include/head.jsp"%>
</head>
<body>
<div class="admin-content">
    <div class="am-g">
        <div class="am-u-sm-12">
            <form id="searchForm" class="am-form-inline" action="${ctx}/cms/site" method="post" style="display: none;">
                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
            </form>
            <div class="am-panel am-panel-default">
                <div class="am-panel-hd">
                    <h4 class="am-panel-title">
                        站点列表
                        <button type="button" class="am-btn am-btn-primary am-btn-xs iu-right"
                                onclick="openModel('新增','${ctx}/cms/site/create')"><span class="am-icon-plus"></span> 新增
                        </button>
                    </h4>
                </div>
                <div class="am-panel-collapse am-collapse am-in">
                    <div class="am-panel-bd">
                        <div class="am-g">
                            <div class="am-u-sm-12">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                    <tr>
                                        <th>站点名称</th>
                                        <th>主题</th>
                                        <th>关键字</th>
                                        <th>更新时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.list}" var="site">
                                        <tr>
                                            <td><a href="${ctxF}?id=${site.id}" target="_blank" title="打开网站">${site.name}<c:if test="${site.isDefault}">（默认）</c:if></a></td>
                                            <td>${site.theme}</td>
                                            <td>${site.keywords}</td>
                                            <td><fmt:formatDate value="${site.updateDate}"
                                                                pattern="yyyy-MM-dd HH:mm:ss" /></td>
                                            <td>
                                                <c:if test="${!site.isDefault}">
                                                    <a href="${ctx}/cms/site/${site.id}/default?pageNo=${page.pageNo}&pageSize=${page.pageSize}"
                                                                                                    onclick="return iuConfirm('确认要设置该网站为默认吗？', this.href)" title="设置默认"><span class="am-text-warning am-icon-heart-o"></span></a>
                                                </c:if>
                                                <a href="${ctx}/cms/site/build?id=${site.id}" title="网站建设"><span class="am-text-success am-icon-sitemap"></span></a>
                                                <a href="javascript:;" onclick="openModel('编辑','${ctx}/cms/site/update?id=${site.id}')" title="编辑"><span class="am-icon-pencil"></span></a>
                                                <a href="${ctx}/cms/site/${site.id}/delete?pageNo=${page.pageNo}&pageSize=${page.pageSize}"
                                                                                               onclick="return iuConfirm('确认要删除该网站吗？', this.href)" title="删除"><span class="am-text-danger am-icon-trash-o"></span></a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                            <div class="am-u-sm-12">
                                <%@ include file="../../utils/pagination.jsp" %>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<%@ include file="../../include/bottom.jsp"%>
<script type="text/javascript">
    $(document).ready(function () {
        var msg = '${msg}';
        if(msg!=''){
            iuMsg(msg);
        }
    });
</script>
</body>
</html>
